package com.cargroup.service;

import com.cargroup.bean.Car;

import com.cargroup.bean.User;
import com.cargroup.dao.CarMapper;
import com.cargroup.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public void insertUser(User user) {
        userMapper.insertUser(user);
    }

    @Transactional
    public void save(User user) throws IOException {
        userMapper.saveImage(user);
    }

    public List<User> getallUser() {
        List<User> users = userMapper.getallUser();
        return users;
    }

    public void editUser(User user) {
        userMapper.editUser(user);
    }

    public void deleteUser(Integer id) {
        userMapper.deleteUser(id);
    }

	public User findUserById(Integer id) {
		// TODO Auto-generated method stub
		return userMapper.findUserById(id);
	}
}
